# -*- coding: utf-8 -*-
"""
__author__ = 'bingo'
__date__ = '2019/2/28'
# code is far away from bugs with the god animal protecting
    I love animals. They taste delicious.
              ┏┓      ┏┓
            ┏┛┻━━━┛┻┓
            ┃      ☃      ┃
            ┃  ┳┛  ┗┳  ┃
            ┃      ┻      ┃
            ┗━┓      ┏━┛
                ┃      ┗━━━┓
                ┃  神兽保佑    ┣┓
                ┃　永无BUG！   ┏┛
                ┗┓┓┏━┳┓┏┛
                  ┃┫┫  ┃┫┫
                  ┗┻┛  ┗┻┛
"""

from django.http import JsonResponse
from .status_code import Code


def status_json(no=Code.OK, msg='', data=None, **kwargs):
    json_dict = {'no': no, 'msg': msg, 'data': data}
    if kwargs and kwargs.keys() and isinstance(kwargs, dict):
        json_dict.update(kwargs)
    return JsonResponse(json_dict)
